#include "STable.h"
#include <cassert>

STable::STable()
{
    //ctor
    pset=0;
}

STable::~STable()
{
    //dtor
}

STable *STable::instance=0;

STable *STable::getInstance()
{
    if(instance==0){
        instance=new STable();
    }
    return instance;
}

const string *STable::pushString(char *str,int len)
{
    assert(str);
    char c;
    c=str[len];
    str[len]='\0';
    if(pset==0){
            pset=new unordered_set<string>(4096);
    }
    unordered_set<string>::iterator iter;
    iter=pset->insert(str).first;
    str[len]=c;
    return &(*iter);
}
